package com.cxl.model;

public class Info {
	public int sizeOrResult;
	public int PCwidth;
	public int PCheight;

	public Info(byte temp[]){
		byte byte1[] = new byte[4];
		byte byte2[] = new byte[4];
		byte byte3[] = new byte[4];
		System.arraycopy(temp, 0, byte1, 0, 4);
		System.arraycopy(temp, 4, byte2, 0, 4);
		System.arraycopy(temp, 8, byte3, 0, 4);
		sizeOrResult = convertirOctetEnEntier(byte1);
		PCwidth = convertirOctetEnEntier(byte2);
		PCheight = convertirOctetEnEntier(byte3);
	}


	public int convertirOctetEnEntier(byte[] b){    
	    int MASK = 0xFF;
	    int result = 0;   
	        result = b[0] & MASK;
	        result = result + ((b[1] & MASK) << 8);
	        result = result + ((b[2] & MASK) << 16);
	        result = result + ((b[3] & MASK) << 24);            
	    return result;
	}
}
